cmake_minimum_required(VERSION 3.3)

set(net_head
        tcp/Channel.h
        reactor/EventLoop.h
        reactor/TimerId.h
        reactor/Timer.h
        reactor/TimerQueue.h
        Buffer.h
        reactor/Poller.h
        poller/PollPoller.h
        poller/EPollPoller.h
        reactor/EventLoopThread.h
        reactor/EventLoopThreadPool.h
        tcp/InetAddress.h
        tcp/SocketUtils.h
        tcp/Socket.h
        tcp/Acceptor.h
        reactor/Callback.h
        TcpConnection.h
        TcpServer.h
        Connector.h
        http/HttpRequest.h
        http/HttpContext.h
        http/HttpResponse.h
        http/HttpServer.h
        http/http.h
        http/HttpServlet.h
        )

#[=[网络相关成员]=]
set(LIBNET_SRC
        tcp/Channel.cpp
        reactor/EventLoop.cpp
        reactor/Timer.cpp
        reactor/TimerQueue.cpp
        Buffer.cpp
        reactor/Poller.cpp
        poller/PollPoller.cpp
        poller/EPollPoller.cpp
        poller/DefaultPoller.cpp
        reactor/EventLoopThread.cpp
        reactor/EventLoopThreadPool.cpp
        tcp/InetAddress.cpp
        tcp/SocketUtils.cpp
        tcp/Socket.cpp
        tcp/Acceptor.cpp
        TcpConnection.cpp
        TcpServer.cpp
        Connector.cpp
        http/HttpContext.cpp
        http/HttpResponse.cpp
        http/HttpServer.cpp
        http/http.cc
        http/HttpServlet.cpp
        )

add_library(net SHARED ${LIBNET_SRC})
target_link_libraries(net base)

install(FILES ${net_head} DESTINATION include/myMuduo/net)
install(TARGETS net DESTINATION lib)